// ValidationAspects
// Written by Mike Saunders
// Released under Microsoft Public License (Ms-PL)
using System;

namespace ValidationAspects.Exceptions
{
	public class ValidateIsEmailException : ValidationException
	{
		public static Func<ValidateIsEmailException, string> MessageFormat { get; set; }

		static ValidateIsEmailException()
		{
			ResetMessageFormat();
		}

		public ValidateIsEmailException(string value)
		{
			Value = value;
		}

		public static void ResetMessageFormat()
		{
			MessageFormat = e => e.GetValidationTargetName() + " is not a valid email.";
		}

		public override string Message
		{
			get { return MessageFormat(this); }
		}

		public object Value { get; private set; }
	}
}